//
//  XLLLoginViewModel.h
//  XLLogin
//
//  Created by 陈宪栋 on 2017/11/15.
//  Copyright © 2017年 BAOMIHUA.COM. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <ReactiveCocoa.h>

typedef NS_ENUM(NSInteger, XLLLoginViewModelStatus) {
    XLLLoginViewModelStatus_Doing = 1,  //请求中
    XLLLoginViewModelStatus_Success,  //请求成功
    XLLLoginViewModelStatus_Fail    //请求失败
};

@interface XLLLoginViewModel : NSObject
@property (nonatomic, copy) NSString *isHostApply;
//手机号
@property (nonatomic, copy) NSString *phone;
//验证码
@property (nonatomic, copy) NSString *code;
//手机号码输入框enable信号
@property (nonatomic, strong, readonly) RACSignal *enablePhoneFieldSignal;
//验证码输入框enable信号
@property (nonatomic, strong, readonly) RACSignal *enableCodeFieldSignal;
//获取验证码信号
@property (nonatomic, strong) RACSignal *queryCodeSignal;
@property (nonatomic, strong) RACSignal *bindSignal;//绑定信号
//登录信号
@property (nonatomic, strong) RACSignal *loginSignal;
//获取验证码状态
@property (nonatomic, assign) XLLLoginViewModelStatus queryCodeStatus;
//获取验证码状态
@property (nonatomic, assign) XLLLoginViewModelStatus BindStatus;
//登录状态
@property (nonatomic, assign) XLLLoginViewModelStatus loginStatus;
//获取验证码错误
@property(nonatomic, strong) NSError *queryCodeError;
//登录错误
@property(nonatomic, strong) NSError *loginError;
@property(nonatomic, strong) NSError *BindError;
//获取验证码时间间隔,根据这个值显示按钮的状态,如需重新设置需要在子类init方法中赋值
@property (nonatomic, assign) NSInteger intervalTime;
//获取时间间隔信号
@property (nonatomic, strong, readonly) RACSignal *intervalTimeSignal;
//获取验证码命令
@property (nonatomic, strong, readonly) RACCommand *queryCodeCommand;
//手机登录命令
@property (nonatomic, strong, readonly) RACCommand *loginCommand;
//手机绑定命令
@property (nonatomic, strong, readonly) RACCommand *bindCommand;
@property (nonatomic, strong, readonly) id data;
@end
